package com.hdl.entity;
/**
 * 购物项对象
 * @author Administrator
 *
 */
public class CartItem {
	
	/**
	 *  product 具体的商品对象
	 */
	private MallProduct product;
	
	/**
	 * num 商品的数量
	 */
	private Integer num;
	
	/**
	 * total 购物项的小计
	 */
	private Integer total;

	public MallProduct getProduct() {
		return product;
	}

	public void setProduct(MallProduct product) {
		this.product = product;
	}

	public Integer getNum() {
		return num;
	}

	public void setNum(Integer num) {
		this.num = num;
	}

	public Integer getTotal() {
		//计算购物项小计
		total = product.getMallProductPrice1() * num;
		return total;
	}

	public void setTotal(Integer total) {
		this.total = total;
	}

	@Override
	public String toString() {
		return "CartItem [product=" + product + ", num=" + num + ", total=" + total + "]";
	}
	
	
}
